﻿using System;
using System.Collections.Generic;
using System.Text;

namespace MethodReturnValueContracts
{
    static class PreventingNull
    {
        [Arcana.Contract.Method.Returns.Is.Not.Null]
        public static object SimpleValue(object retValue)
        {
            return retValue;
        }

        [Arcana.Contract.Method.Returns.Is.Not.Null(Exception = typeof(ArgumentNullException))]
        public static object SimpleValueAndCustomException(object retValue)
        {
            return retValue;
        }

        [Arcana.Contract.Method.Returns.All.Are.Not.Null]
        public static IEnumerable<string> CollectionValue(IEnumerable<string> retValue)
        {
            return retValue;
        }

        [Arcana.Contract.Method.Returns.All.Are.Not.Null(Exception = typeof(ArgumentException))]
        public static IEnumerable<string> CollectionValueAndCustomException(IEnumerable<string> retValue)
        {
            return retValue;
        }
    }
}
